
//               File: InvoiceDataSet
//        Description: Invoice
//             Author: DeKlarit - Language C# - Generator Version 10_1_3-31907 - Specifier Version 10_1_3.31907
//       Program type: Deklarit Business Component
//          Main DBMS: Microsoft SqlServer

namespace DeklaritModel {
   using System;
   using System.Collections;
   using System.Data;
   using System.Data.SqlClient;
   using System.Data.Common;
   using System.ComponentModel.Design;
   using System.Xml;
   using System.Configuration;
   using System.Data.SqlTypes;
   [Serializable()]
   public partial class InvoiceDataSet : System.Data.DataSet
   {
      private InvoiceLineDataTable tableInvoiceLine ;
      [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
      public InvoiceLineDataTable InvoiceLine
      {
         get {
            return this.tableInvoiceLine ;
         }

      }

      private InvoiceDataTable tableInvoice ;
      [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)]
      public InvoiceDataTable Invoice
      {
         get {
            return this.tableInvoice ;
         }

      }

      private System.Data.SchemaSerializationMode _schemaSerializationMode = System.Data.SchemaSerializationMode.ExcludeSchema;
      
      [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
      public InvoiceDataSet() {
          this.BeginInit();
          this.InitClass();
          System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
          base.Tables.CollectionChanged += schemaChangedHandler;
          base.Relations.CollectionChanged += schemaChangedHandler;
          this.EndInit();
      }
      
      public override System.Data.SchemaSerializationMode SchemaSerializationMode {
          get {
              return this._schemaSerializationMode;
          }
          set {
              this._schemaSerializationMode = value;
          }
      }
      
      [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
      public new System.Data.DataTableCollection Tables {
          get {
              return base.Tables;
          }
      }
      
      [System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
      public new System.Data.DataRelationCollection Relations {
          get {
              return base.Relations;
          }
      }
      
      [System.ComponentModel.DefaultValueAttribute(true)]
      public new bool EnforceConstraints {
          get {
              return base.EnforceConstraints;
          }
          set {
              base.EnforceConstraints = value;
          }
      }
      
      protected override void InitializeDerivedDataSet() {
          this.BeginInit();
          this.InitClassBase();
          this.EndInit();
      }
      
      public override System.Data.DataSet Clone() {
          InvoiceDataSet cln = ((InvoiceDataSet)(base.Clone()));
          cln.InitVars();
          return cln;
      }
      
      protected override bool ShouldSerializeTables() {
      	    return false;
      }
      
      protected override bool ShouldSerializeRelations() {
      	    return false;
      }
      
      private bool ShouldSerializeInvoiceLine() { 
		return false; 
	  }
      private bool ShouldSerializeInvoice() { 
		return false; 
	  }
              
      protected override void ReadXmlSerializable(XmlReader reader) 
      {
          if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) 
          {
      		this.Reset();
      		DataSet ds = new DataSet();
              ds.ReadXml(reader);
              if ((ds.Tables["InvoiceLine"] != null))  
        { 
			base.Tables.Add(new InvoiceLineDataTable(ds.Tables["InvoiceLine"])); 
        }		
              if ((ds.Tables["Invoice"] != null))  
        { 
			base.Tables.Add(new InvoiceDataTable(ds.Tables["Invoice"])); 
        }		
      	    this.DataSetName = ds.DataSetName;
      		this.Prefix = ds.Prefix;
      		this.Namespace = ds.Namespace;
      		this.Locale = ds.Locale;
      		this.CaseSensitive = ds.CaseSensitive;
      		this.EnforceConstraints = ds.EnforceConstraints;
      		this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
      		this.InitVars();
      	}
          else 
          {
      	  this.ExtendedProperties.Clear();
              this.ReadXml(reader);
              this.InitVars();
          }
      }
      
      protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() 
      {
          System.IO.MemoryStream stream = new System.IO.MemoryStream();
          this.WriteXmlSchema(new XmlTextWriter(stream, null));
          stream.Position = 0;
          return System.Xml.Schema.XmlSchema.Read(new XmlTextReader(stream), null);
      }
      
      internal void InitVars() 
      {
      	this.InitVars(true);
      }
      
      internal void InitVars(bool initTable) {
          this.tableInvoiceLine = ((InvoiceLineDataTable)(base.Tables["InvoiceLine"]));		
		  if ((initTable == true)) { 
			if ((this.tableInvoiceLine != null)) { 
				this.tableInvoiceLine.InitVars(); 
			} 
	  	  }  
          this.tableInvoice = ((InvoiceDataTable)(base.Tables["Invoice"]));		
		  if ((initTable == true)) { 
			if ((this.tableInvoice != null)) { 
				this.tableInvoice.InitVars(); 
			} 
	  	  }  
      	this.RemotingFormat = SerializationFormat.Binary;
      } 
             
      private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
          if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
              this.InitVars();
          }
      }
      
      public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) {
          InvoiceDataSet ds = new InvoiceDataSet();
          System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
          System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
          xs.Add(ds.GetSchemaSerializable());
          System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
          any.Namespace = ds.Namespace;
          sequence.Items.Add(any);
          type.Particle = sequence;
          return type;
      }
      [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
      protected InvoiceDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context, false)
      {
      	if ((this.IsBinarySerialized(info, context) == true)) 
      	{
      		this.InitVars(false);
      		System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
      		this.Tables.CollectionChanged += schemaChangedHandler1;
      		this.Relations.CollectionChanged += schemaChangedHandler1;
      		return;
      	}
      
      	string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
      	if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) 
      	{
      		System.Data.DataSet ds = new System.Data.DataSet();
              ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
              if ((ds.Tables["InvoiceLine"] != null))  
        { 
			base.Tables.Add(new InvoiceLineDataTable(ds.Tables["InvoiceLine"])); 
        }        
              if ((ds.Tables["Invoice"] != null))  
        { 
			base.Tables.Add(new InvoiceDataTable(ds.Tables["Invoice"])); 
        }        
              this.DataSetName = ds.DataSetName;
              this.Prefix = ds.Prefix;
              this.Namespace = ds.Namespace;
              this.Locale = ds.Locale;
              this.CaseSensitive = ds.CaseSensitive;
              this.EnforceConstraints = ds.EnforceConstraints;
              this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
              this.InitVars();
           }
           else 
           {
      		this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
           }
           
           this.GetSerializationData(info, context);
           System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
           base.Tables.CollectionChanged += schemaChangedHandler;
           this.Relations.CollectionChanged += schemaChangedHandler;
      }
      
      private void InitClass( )
      {
         InitClassBase( ) ;
         this.ExtendedProperties.Add( "DataAdapterName", "InvoiceDataAdapter") ;
         this.ExtendedProperties.Add( "Deklarit.PermissionBaseId", "2001") ;
         this.ExtendedProperties.Add( "DataSetName", "InvoiceDataSet") ;
         this.ExtendedProperties.Add( "DataAdapterInterfaceName", "IInvoiceDataAdapter") ;
         this.ExtendedProperties.Add( "ObjectName", "Invoice") ;
         this.ExtendedProperties.Add( "ObjectDescription", "Invoice") ;
         this.ExtendedProperties.Add( "ObjectType", "BusinessComponent") ;
         this.ExtendedProperties.Add( "ObjectPath", "\\Objects") ;
         this.ExtendedProperties.Add( "NameSpace", "DeklaritModel") ;
         this.ExtendedProperties.Add( "DataChangeFrequency", "PrettyOften") ;
         this.ExtendedProperties.Add( "CachePriority", "Medium") ;
         this.ExtendedProperties.Add( "Deklarit.AddNewOptionToLowCardinality", "True") ;
         this.ExtendedProperties.Add( "Deklarit.DescriptionAttribute", "") ;
         this.ExtendedProperties.Add( "Deklarit.LowCardinality", "False") ;
         this.ExtendedProperties.Add( "Deklarit.FormReport", "true") ;
         this.ExtendedProperties.Add( "Deklarit.InstanceReport", "false") ;
         this.ExtendedProperties.Add( "Deklarit.ListReport", "true") ;
      }

      private void InitClassBase( )
      {
         this.DataSetName = "InvoiceDataSet" ;
         this.Namespace = "http://www.tempuri.org/Invoice" ;
         this.tableInvoiceLine = new InvoiceLineDataTable() ;
         this.Tables.Add( this.tableInvoiceLine) ;
         this.tableInvoice = new InvoiceDataTable() ;
         this.Tables.Add( this.tableInvoice) ;
         this.Relations.Add( "Invoice_InvoiceLine", new  System.Data.DataColumn[]  {this.Tables["Invoice"].Columns["InvoiceId"]}, new  System.Data.DataColumn[]  {this.Tables["InvoiceLine"].Columns["InvoiceId"]}) ;
         this.Relations["Invoice_InvoiceLine"].Nested = true ;
      }

      public delegate  void InvoiceLineRowChangeEventHandler( object sender ,
                                                              InvoiceLineRowChangeEvent e );
      [Serializable()]
      public partial class InvoiceLineDataTable : DataTable, System.Collections.IEnumerable
      {
         private DataColumn columnInvoiceId ;
         private DataColumn columnInvoiceLineId ;
         private DataColumn columnProductId ;
         private DataColumn columnProductName ;
         private DataColumn columnInvoiceLineProductValue ;
         private DataColumn columnInvoiceLineProductQuantity ;
         public InvoiceLineDataTable() 
         {
             this.TableName = "InvoiceLine";
             this.BeginInit();
             this.InitClass();
             this.EndInit();
         }
         
         internal InvoiceLineDataTable(System.Data.DataTable table) {
             this.TableName = table.TableName;
             if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                 this.CaseSensitive = table.CaseSensitive;
             }
             if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                 this.Locale = table.Locale;
             }
             if ((table.Namespace != table.DataSet.Namespace)) {
                 this.Namespace = table.Namespace;
             }
             this.Prefix = table.Prefix;
             this.MinimumCapacity = table.MinimumCapacity;
         }
         
         [System.ComponentModel.Browsable(false)]
         public int Count {
             get {
                 return this.Rows.Count;
             }
         }
         
         public InvoiceLineRow this[int index] {
             get {
                 return ((InvoiceLineRow)(this.Rows[index]));
             }
         }
         
         public virtual System.Collections.IEnumerator GetEnumerator() {
             return this.Rows.GetEnumerator();
         }
         
         public override System.Data.DataTable Clone() {
             InvoiceLineDataTable cln = ((InvoiceLineDataTable)(base.Clone()));
             cln.InitVars();
             return cln;
         }
         
         protected override System.Data.DataTable CreateInstance() {
             return new InvoiceLineDataTable();
         }
         
         public void AddInvoiceLineRow(InvoiceLineRow row) {
             this.Rows.Add(row);
         }
         
         public InvoiceLineRow NewInvoiceLineRow() {
             return ((InvoiceLineRow)(this.NewRow()));
         }
         
         protected override System.Data.DataRow NewRowFromBuilder(System.Data.DataRowBuilder builder) {
             return new InvoiceLineRow(builder);
         }
         
         protected override System.Type GetRowType() {
             return typeof(InvoiceLineRow);
         }
         
         public void RemoveInvoiceLineRow(InvoiceLineRow row) {
             this.Rows.Remove(row);
         }
         
         public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) {
             System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
             System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
             InvoiceDataSet ds = new InvoiceDataSet();
             xs.Add(ds.GetSchemaSerializable());
             System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
             any1.Namespace = "http://www.w3.org/2001/XMLSchema";
             any1.MinOccurs = new decimal(0);
             any1.MaxOccurs = decimal.MaxValue;
             any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
             sequence.Items.Add(any1);
             System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
             any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
             any2.MinOccurs = new decimal(1);
             any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
             sequence.Items.Add(any2);
             System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
             attribute1.Name = "namespace";
             attribute1.FixedValue = ds.Namespace;
             type.Attributes.Add(attribute1);
             System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
             attribute2.Name = "tableTypeName";
             attribute2.FixedValue = "InvoiceLineDataTable";
             type.Attributes.Add(attribute2);
             type.Particle = sequence;
             return type;
         }
         protected InvoiceLineDataTable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                 base(info, context) 
         {
             this.InitVars();
         }
         public DataColumn InvoiceIdColumn
         {
            get {
               return this.columnInvoiceId ;
            }

         }

         public DataColumn InvoiceLineIdColumn
         {
            get {
               return this.columnInvoiceLineId ;
            }

         }

         public DataColumn ProductIdColumn
         {
            get {
               return this.columnProductId ;
            }

         }

         public DataColumn ProductNameColumn
         {
            get {
               return this.columnProductName ;
            }

         }

         public DataColumn InvoiceLineProductValueColumn
         {
            get {
               return this.columnInvoiceLineProductValue ;
            }

         }

         public DataColumn InvoiceLineProductQuantityColumn
         {
            get {
               return this.columnInvoiceLineProductQuantity ;
            }

         }

         public event InvoiceLineRowChangeEventHandler InvoiceLineRowChanged ;
         public event InvoiceLineRowChangeEventHandler InvoiceLineRowChanging ;
         public event InvoiceLineRowChangeEventHandler InvoiceLineRowDeleted ;
         public event InvoiceLineRowChangeEventHandler InvoiceLineRowDeleting ;
         public InvoiceLineRow AddInvoiceLineRow( short invoiceId ,
                                                  short invoiceLineId ,
                                                  short productId ,
                                                  decimal invoiceLineProductValue ,
                                                  short invoiceLineProductQuantity )
         {
            InvoiceLineRow rowInvoiceLineRow = ((InvoiceLineRow)(this.NewRow())) ;
            rowInvoiceLineRow["InvoiceId"] = invoiceId ;
            rowInvoiceLineRow["InvoiceLineId"] = invoiceLineId ;
            rowInvoiceLineRow["ProductId"] = productId ;
            rowInvoiceLineRow["InvoiceLineProductValue"] = invoiceLineProductValue ;
            rowInvoiceLineRow["InvoiceLineProductQuantity"] = invoiceLineProductQuantity ;
            this.Rows.Add( rowInvoiceLineRow) ;
            return rowInvoiceLineRow ;
         }

         public InvoiceLineRow FindByInvoiceIdInvoiceLineId( short invoiceId ,
                                                             short invoiceLineId )
         {
            return ((InvoiceLineRow)(this.Rows.Find(new  object[] {invoiceId, invoiceLineId}))) ;
         }

         internal void InitVars( )
         {
            this.columnInvoiceId = this.Columns["InvoiceId"] ;
            this.columnInvoiceLineId = this.Columns["InvoiceLineId"] ;
            this.columnProductId = this.Columns["ProductId"] ;
            this.columnProductName = this.Columns["ProductName"] ;
            this.columnInvoiceLineProductValue = this.Columns["InvoiceLineProductValue"] ;
            this.columnInvoiceLineProductQuantity = this.Columns["InvoiceLineProductQuantity"] ;
         }

         public void InitClass( )
         {
            this.columnInvoiceId = new DataColumn( "InvoiceId", typeof(short), "", System.Data.MappingType.Element) ;
            this.columnInvoiceId.AllowDBNull = false ;
            this.columnInvoiceId.Caption = "Invoice Id" ;
            this.columnInvoiceId.ExtendedProperties.Add( "IsKey", "true") ;
            this.columnInvoiceId.ExtendedProperties.Add( "ReadOnly", "true") ;
            this.columnInvoiceId.ExtendedProperties.Add( "DeklaritType", "int") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Description", "Invoice Id") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Length", "4") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnInvoiceId.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnInvoiceId.ExtendedProperties.Add( "IsInReader", "true") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Deklarit.InternalName", "InvoiceId") ;
            this.Columns.Add( this.columnInvoiceId) ;
            this.columnInvoiceLineId = new DataColumn( "InvoiceLineId", typeof(short), "", System.Data.MappingType.Element) ;
            this.columnInvoiceLineId.AllowDBNull = false ;
            this.columnInvoiceLineId.Caption = "Id" ;
            this.columnInvoiceLineId.DefaultValue = System.Convert.DBNull ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "IsKey", "true") ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "ReadOnly", "false") ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "DeklaritType", "int") ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "Description", "Id") ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "Length", "4") ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnInvoiceLineId.ExtendedProperties.Add( "Deklarit.InternalName", "InvoiceLineId") ;
            this.Columns.Add( this.columnInvoiceLineId) ;
            this.columnProductId = new DataColumn( "ProductId", typeof(short), "", System.Data.MappingType.Element) ;
            this.columnProductId.AllowDBNull = false ;
            this.columnProductId.Caption = "Id" ;
            this.columnProductId.DefaultValue = System.Convert.DBNull ;
            this.columnProductId.ExtendedProperties.Add( "IsKey", "false") ;
            this.columnProductId.ExtendedProperties.Add( "ReadOnly", "false") ;
            this.columnProductId.ExtendedProperties.Add( "DeklaritType", "int") ;
            this.columnProductId.ExtendedProperties.Add( "Description", "Id") ;
            this.columnProductId.ExtendedProperties.Add( "Length", "4") ;
            this.columnProductId.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnProductId.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnProductId.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnProductId.ExtendedProperties.Add( "Deklarit.InternalName", "ProductId") ;
            this.Columns.Add( this.columnProductId) ;
            this.columnProductName = new DataColumn( "ProductName", typeof(String), "", System.Data.MappingType.Element) ;
            this.columnProductName.AllowDBNull = true ;
            this.columnProductName.Caption = "Name" ;
            this.columnProductName.MaxLength = 20 ;
            this.columnProductName.DefaultValue = System.Convert.DBNull ;
            this.columnProductName.ExtendedProperties.Add( "IsKey", "false") ;
            this.columnProductName.ExtendedProperties.Add( "ReadOnly", "true") ;
            this.columnProductName.ExtendedProperties.Add( "DeklaritType", "char") ;
            this.columnProductName.ExtendedProperties.Add( "Description", "Name") ;
            this.columnProductName.ExtendedProperties.Add( "Length", "20") ;
            this.columnProductName.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnProductName.ExtendedProperties.Add( "AllowDBNulls", "true") ;
            this.columnProductName.ExtendedProperties.Add( "Deklarit.Casing", "default") ;
            this.columnProductName.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnProductName.ExtendedProperties.Add( "Deklarit.InternalName", "ProductName") ;
            this.Columns.Add( this.columnProductName) ;
            this.columnInvoiceLineProductValue = new DataColumn( "InvoiceLineProductValue", typeof(decimal), "", System.Data.MappingType.Element) ;
            this.columnInvoiceLineProductValue.AllowDBNull = false ;
            this.columnInvoiceLineProductValue.Caption = "Value" ;
            this.columnInvoiceLineProductValue.DefaultValue = System.Convert.DBNull ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "IsKey", "false") ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "ReadOnly", "false") ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "DeklaritType", "int") ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "Description", "Value") ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "Length", "9") ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "Decimals", "2") ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnInvoiceLineProductValue.ExtendedProperties.Add( "Deklarit.InternalName", "InvoiceLineProductValue") ;
            this.Columns.Add( this.columnInvoiceLineProductValue) ;
            this.columnInvoiceLineProductQuantity = new DataColumn( "InvoiceLineProductQuantity", typeof(short), "", System.Data.MappingType.Element) ;
            this.columnInvoiceLineProductQuantity.AllowDBNull = false ;
            this.columnInvoiceLineProductQuantity.Caption = "Quantity" ;
            this.columnInvoiceLineProductQuantity.DefaultValue = System.Convert.DBNull ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "IsKey", "false") ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "ReadOnly", "false") ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "DeklaritType", "int") ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "Description", "Quantity") ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "Length", "4") ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnInvoiceLineProductQuantity.ExtendedProperties.Add( "Deklarit.InternalName", "InvoiceLineProductQuantity") ;
            this.Columns.Add( this.columnInvoiceLineProductQuantity) ;
            this.PrimaryKey = new  DataColumn[]  {this.columnInvoiceId, this.columnInvoiceLineId} ;
            this.ExtendedProperties.Add( "ParentLvl", "Invoice") ;
            this.ExtendedProperties.Add( "LevelName", "Line") ;
            this.ExtendedProperties.Add( "Description", "Line") ;
            this.ExtendedProperties.Add( "msprop:AllowInsert", "true") ;
            this.ExtendedProperties.Add( "msprop:AllowUpdate", "true") ;
            this.ExtendedProperties.Add( "msprop:AllowDelete", "true") ;
            this.ExtendedProperties.Add( "Deklarit.EditInDataGrid", "True") ;
         }

         protected override void OnRowChanged( DataRowChangeEventArgs e )
         {
            base.OnRowChanged( e) ;
            if ( this.InvoiceLineRowChanged != null )
            {
               this.InvoiceLineRowChanged( this, new InvoiceLineRowChangeEvent( ((InvoiceLineRow)(e.Row)), e.Action)) ;
            }
         }

         protected override void OnRowChanging( DataRowChangeEventArgs e )
         {
            base.OnRowChanging( e) ;
            if ( this.InvoiceLineRowChanging != null )
            {
               this.InvoiceLineRowChanging( this, new InvoiceLineRowChangeEvent( ((InvoiceLineRow)(e.Row)), e.Action)) ;
            }
         }

         protected override void OnRowDeleted( DataRowChangeEventArgs e )
         {
            base.OnRowDeleted( e) ;
            DataRow pRow = e.Row.GetParentRow( "Invoice_InvoiceLine", System.Data.DataRowVersion.Original) ;
            if ( ( pRow != null ) && ( pRow.RowState == System.Data.DataRowState.Unchanged ) )
            {
               pRow[0] = pRow[0] ;
            }
            if ( this.InvoiceLineRowDeleted != null )
            {
               this.InvoiceLineRowDeleted( this, new InvoiceLineRowChangeEvent( ((InvoiceLineRow)(e.Row)), e.Action)) ;
            }
         }

         protected override void OnRowDeleting( DataRowChangeEventArgs e )
         {
            base.OnRowDeleting( e) ;
            if ( this.InvoiceLineRowDeleting != null )
            {
               this.InvoiceLineRowDeleting( this, new InvoiceLineRowChangeEvent( ((InvoiceLineRow)(e.Row)), e.Action)) ;
            }
         }

      }

      public delegate  void InvoiceRowChangeEventHandler( object sender ,
                                                          InvoiceRowChangeEvent e );
      [Serializable()]
      public partial class InvoiceDataTable : DataTable, System.Collections.IEnumerable
      {
         private DataColumn columnInvoiceId ;
         private DataColumn columnInvoiceDescription ;
         private DataColumn columnClienteId ;
         private DataColumn columnClienteName ;
         private DataColumn columnInvoiceLineLastIndex ;
         public InvoiceDataTable() 
         {
             this.TableName = "Invoice";
             this.BeginInit();
             this.InitClass();
             this.EndInit();
         }
         
         internal InvoiceDataTable(System.Data.DataTable table) {
             this.TableName = table.TableName;
             if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
                 this.CaseSensitive = table.CaseSensitive;
             }
             if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
                 this.Locale = table.Locale;
             }
             if ((table.Namespace != table.DataSet.Namespace)) {
                 this.Namespace = table.Namespace;
             }
             this.Prefix = table.Prefix;
             this.MinimumCapacity = table.MinimumCapacity;
         }
         
         [System.ComponentModel.Browsable(false)]
         public int Count {
             get {
                 return this.Rows.Count;
             }
         }
         
         public InvoiceRow this[int index] {
             get {
                 return ((InvoiceRow)(this.Rows[index]));
             }
         }
         
         public virtual System.Collections.IEnumerator GetEnumerator() {
             return this.Rows.GetEnumerator();
         }
         
         public override System.Data.DataTable Clone() {
             InvoiceDataTable cln = ((InvoiceDataTable)(base.Clone()));
             cln.InitVars();
             return cln;
         }
         
         protected override System.Data.DataTable CreateInstance() {
             return new InvoiceDataTable();
         }
         
         public void AddInvoiceRow(InvoiceRow row) {
             this.Rows.Add(row);
         }
         
         public InvoiceRow NewInvoiceRow() {
             return ((InvoiceRow)(this.NewRow()));
         }
         
         protected override System.Data.DataRow NewRowFromBuilder(System.Data.DataRowBuilder builder) {
             return new InvoiceRow(builder);
         }
         
         protected override System.Type GetRowType() {
             return typeof(InvoiceRow);
         }
         
         public void RemoveInvoiceRow(InvoiceRow row) {
             this.Rows.Remove(row);
         }
         
         public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) {
             System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
             System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
             InvoiceDataSet ds = new InvoiceDataSet();
             xs.Add(ds.GetSchemaSerializable());
             System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
             any1.Namespace = "http://www.w3.org/2001/XMLSchema";
             any1.MinOccurs = new decimal(0);
             any1.MaxOccurs = decimal.MaxValue;
             any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
             sequence.Items.Add(any1);
             System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
             any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
             any2.MinOccurs = new decimal(1);
             any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
             sequence.Items.Add(any2);
             System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
             attribute1.Name = "namespace";
             attribute1.FixedValue = ds.Namespace;
             type.Attributes.Add(attribute1);
             System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
             attribute2.Name = "tableTypeName";
             attribute2.FixedValue = "InvoiceDataTable";
             type.Attributes.Add(attribute2);
             type.Particle = sequence;
             return type;
         }
         protected InvoiceDataTable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                 base(info, context) 
         {
             this.InitVars();
         }
         public DataColumn InvoiceIdColumn
         {
            get {
               return this.columnInvoiceId ;
            }

         }

         public DataColumn InvoiceDescriptionColumn
         {
            get {
               return this.columnInvoiceDescription ;
            }

         }

         public DataColumn ClienteIdColumn
         {
            get {
               return this.columnClienteId ;
            }

         }

         public DataColumn ClienteNameColumn
         {
            get {
               return this.columnClienteName ;
            }

         }

         public DataColumn InvoiceLineLastIndexColumn
         {
            get {
               return this.columnInvoiceLineLastIndex ;
            }

         }

         public event InvoiceRowChangeEventHandler InvoiceRowChanged ;
         public event InvoiceRowChangeEventHandler InvoiceRowChanging ;
         public event InvoiceRowChangeEventHandler InvoiceRowDeleted ;
         public event InvoiceRowChangeEventHandler InvoiceRowDeleting ;
         public InvoiceRow AddInvoiceRow( String invoiceDescription ,
                                          short clienteId ,
                                          short invoiceLineLastIndex )
         {
            InvoiceRow rowInvoiceRow = ((InvoiceRow)(this.NewRow())) ;
            rowInvoiceRow["InvoiceDescription"] = invoiceDescription ;
            rowInvoiceRow["ClienteId"] = clienteId ;
            rowInvoiceRow["InvoiceLineLastIndex"] = invoiceLineLastIndex ;
            this.Rows.Add( rowInvoiceRow) ;
            return rowInvoiceRow ;
         }

         public InvoiceRow FindByInvoiceId( short invoiceId )
         {
            return ((InvoiceRow)(this.Rows.Find(new  object[] {invoiceId}))) ;
         }

         internal void InitVars( )
         {
            this.columnInvoiceId = this.Columns["InvoiceId"] ;
            this.columnInvoiceDescription = this.Columns["InvoiceDescription"] ;
            this.columnClienteId = this.Columns["ClienteId"] ;
            this.columnClienteName = this.Columns["ClienteName"] ;
            this.columnInvoiceLineLastIndex = this.Columns["InvoiceLineLastIndex"] ;
         }

         public void InitClass( )
         {
            this.columnInvoiceId = new DataColumn( "InvoiceId", typeof(short), "", System.Data.MappingType.Element) ;
            this.columnInvoiceId.AllowDBNull = false ;
            this.columnInvoiceId.Caption = "Invoice Id" ;
            this.columnInvoiceId.Unique = true ;
            this.columnInvoiceId.AutoIncrement = true ;
            this.columnInvoiceId.AutoIncrementSeed = -1 ;
            this.columnInvoiceId.AutoIncrementStep = -1 ;
            this.columnInvoiceId.ExtendedProperties.Add( "AutoNumber", "true") ;
            this.columnInvoiceId.ExtendedProperties.Add( "IsKey", "true") ;
            this.columnInvoiceId.ExtendedProperties.Add( "ReadOnly", "false") ;
            this.columnInvoiceId.ExtendedProperties.Add( "DeklaritType", "int") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Description", "Invoice Id") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Length", "4") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnInvoiceId.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnInvoiceId.ExtendedProperties.Add( "IsInReader", "true") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnInvoiceId.ExtendedProperties.Add( "Deklarit.InternalName", "InvoiceId") ;
            this.Columns.Add( this.columnInvoiceId) ;
            this.columnInvoiceDescription = new DataColumn( "InvoiceDescription", typeof(String), "", System.Data.MappingType.Element) ;
            this.columnInvoiceDescription.AllowDBNull = false ;
            this.columnInvoiceDescription.Caption = "Invoice Description" ;
            this.columnInvoiceDescription.MaxLength = 20 ;
            this.columnInvoiceDescription.DefaultValue = System.Convert.DBNull ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "IsKey", "false") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "ReadOnly", "false") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "DeklaritType", "char") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "Description", "Invoice Description") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "Length", "20") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "IsInReader", "true") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "Deklarit.Casing", "default") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnInvoiceDescription.ExtendedProperties.Add( "Deklarit.InternalName", "InvoiceDescription") ;
            this.Columns.Add( this.columnInvoiceDescription) ;
            this.columnClienteId = new DataColumn( "ClienteId", typeof(short), "", System.Data.MappingType.Element) ;
            this.columnClienteId.AllowDBNull = false ;
            this.columnClienteId.Caption = "Cliente" ;
            this.columnClienteId.DefaultValue = System.Convert.DBNull ;
            this.columnClienteId.ExtendedProperties.Add( "IsKey", "false") ;
            this.columnClienteId.ExtendedProperties.Add( "ReadOnly", "false") ;
            this.columnClienteId.ExtendedProperties.Add( "DeklaritType", "int") ;
            this.columnClienteId.ExtendedProperties.Add( "Description", "Cliente") ;
            this.columnClienteId.ExtendedProperties.Add( "Length", "4") ;
            this.columnClienteId.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnClienteId.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnClienteId.ExtendedProperties.Add( "IsInReader", "true") ;
            this.columnClienteId.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnClienteId.ExtendedProperties.Add( "Deklarit.InternalName", "ClienteId") ;
            this.Columns.Add( this.columnClienteId) ;
            this.columnClienteName = new DataColumn( "ClienteName", typeof(String), "", System.Data.MappingType.Element) ;
            this.columnClienteName.AllowDBNull = true ;
            this.columnClienteName.Caption = "Cliente" ;
            this.columnClienteName.MaxLength = 20 ;
            this.columnClienteName.DefaultValue = System.Convert.DBNull ;
            this.columnClienteName.ExtendedProperties.Add( "IsKey", "false") ;
            this.columnClienteName.ExtendedProperties.Add( "ReadOnly", "true") ;
            this.columnClienteName.ExtendedProperties.Add( "DeklaritType", "char") ;
            this.columnClienteName.ExtendedProperties.Add( "Description", "Cliente") ;
            this.columnClienteName.ExtendedProperties.Add( "Length", "20") ;
            this.columnClienteName.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnClienteName.ExtendedProperties.Add( "AllowDBNulls", "true") ;
            this.columnClienteName.ExtendedProperties.Add( "IsInReader", "true") ;
            this.columnClienteName.ExtendedProperties.Add( "Deklarit.Casing", "default") ;
            this.columnClienteName.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnClienteName.ExtendedProperties.Add( "Deklarit.InternalName", "ClienteName") ;
            this.Columns.Add( this.columnClienteName) ;
            this.columnInvoiceLineLastIndex = new DataColumn( "InvoiceLineLastIndex", typeof(short), "", System.Data.MappingType.Element) ;
            this.columnInvoiceLineLastIndex.AllowDBNull = false ;
            this.columnInvoiceLineLastIndex.Caption = "Invoice Line Last Index" ;
            this.columnInvoiceLineLastIndex.DefaultValue = System.Convert.DBNull ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "IsKey", "false") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "ReadOnly", "false") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "DeklaritType", "int") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "Description", "Invoice Line Last Index") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "Length", "4") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "Decimals", "0") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "AllowDBNulls", "false") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "IsInReader", "true") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "Deklarit.IsPassword", "false") ;
            this.columnInvoiceLineLastIndex.ExtendedProperties.Add( "Deklarit.InternalName", "InvoiceLineLastIndex") ;
            this.Columns.Add( this.columnInvoiceLineLastIndex) ;
            this.PrimaryKey = new  DataColumn[]  {this.columnInvoiceId} ;
            this.ExtendedProperties.Add( "ParentLvl", "") ;
            this.ExtendedProperties.Add( "LevelName", "Invoice") ;
            this.ExtendedProperties.Add( "Description", "Invoice") ;
            this.ExtendedProperties.Add( "msprop:AllowInsert", "true") ;
            this.ExtendedProperties.Add( "msprop:AllowUpdate", "true") ;
            this.ExtendedProperties.Add( "msprop:AllowDelete", "true") ;
            this.ExtendedProperties.Add( "Deklarit.EditInDataGrid", "True") ;
         }

         protected override void OnRowChanged( DataRowChangeEventArgs e )
         {
            base.OnRowChanged( e) ;
            if ( this.InvoiceRowChanged != null )
            {
               this.InvoiceRowChanged( this, new InvoiceRowChangeEvent( ((InvoiceRow)(e.Row)), e.Action)) ;
            }
         }

         protected override void OnRowChanging( DataRowChangeEventArgs e )
         {
            base.OnRowChanging( e) ;
            if ( this.InvoiceRowChanging != null )
            {
               this.InvoiceRowChanging( this, new InvoiceRowChangeEvent( ((InvoiceRow)(e.Row)), e.Action)) ;
            }
         }

         protected override void OnRowDeleted( DataRowChangeEventArgs e )
         {
            base.OnRowDeleted( e) ;
            if ( this.InvoiceRowDeleted != null )
            {
               this.InvoiceRowDeleted( this, new InvoiceRowChangeEvent( ((InvoiceRow)(e.Row)), e.Action)) ;
            }
         }

         protected override void OnRowDeleting( DataRowChangeEventArgs e )
         {
            base.OnRowDeleting( e) ;
            if ( this.InvoiceRowDeleting != null )
            {
               this.InvoiceRowDeleting( this, new InvoiceRowChangeEvent( ((InvoiceRow)(e.Row)), e.Action)) ;
            }
         }

      }

      public class InvoiceLineRow : DataRow
      {
         private InvoiceLineDataTable tableInvoiceLine ;
         internal InvoiceLineRow( DataRowBuilder rb ) : base(rb)
         {
            this.tableInvoiceLine = ((InvoiceLineDataTable)(this.Table)) ;
         }

         public InvoiceRow GetInvoiceRow( )
         {
            return ((InvoiceRow)(this.GetParentRow( "Invoice_InvoiceLine"))) ;
         }

         ///  <summary>
         ///   Gets or sets the Invoice Id.
         ///  </summary>
         public short InvoiceId
         {
            get {
               return ((short)(this[this.tableInvoiceLine.InvoiceIdColumn])) ;
            }

            set {
               this[this.tableInvoiceLine.InvoiceIdColumn] = value ;
            }

         }

         public bool IsInvoiceIdNull( )
         {
            return this.IsNull( this.tableInvoiceLine.InvoiceIdColumn) ;
         }

         ///  <summary>
         ///   Gets or sets the Id.
         ///  </summary>
         public short InvoiceLineId
         {
            get {
               return ((short)(this[this.tableInvoiceLine.InvoiceLineIdColumn])) ;
            }

            set {
               this[this.tableInvoiceLine.InvoiceLineIdColumn] = value ;
            }

         }

         public bool IsInvoiceLineIdNull( )
         {
            return this.IsNull( this.tableInvoiceLine.InvoiceLineIdColumn) ;
         }

         ///  <summary>
         ///   Gets or sets the Id.
         ///  </summary>
         public short ProductId
         {
            get {
               try
               {
                  return ((short)(this[this.tableInvoiceLine.ProductIdColumn])) ;
               }
               catch ( InvalidCastException deklaritException )
               {
                  throw new StrongTypingException( "Cannot get value ProductId because it is DBNull.", deklaritException) ;
               }
            }

            set {
               this[this.tableInvoiceLine.ProductIdColumn] = value ;
            }

         }

         public bool IsProductIdNull( )
         {
            return this.IsNull( this.tableInvoiceLine.ProductIdColumn) ;
         }

         public void SetProductIdNull( )
         {
            this[this.tableInvoiceLine.ProductIdColumn] = System.Convert.DBNull ;
         }

         ///  <summary>
         ///   Gets or sets the Name.
         ///  </summary>
         public String ProductName
         {
            get {
               try
               {
                  return ((String)(this[this.tableInvoiceLine.ProductNameColumn])) ;
               }
               catch ( InvalidCastException deklaritException )
               {
                  throw new StrongTypingException( "Cannot get value ProductName because it is DBNull.", deklaritException) ;
               }
            }

            set {
               this[this.tableInvoiceLine.ProductNameColumn] = value ;
            }

         }

         public bool IsProductNameNull( )
         {
            return this.IsNull( this.tableInvoiceLine.ProductNameColumn) ;
         }

         public void SetProductNameNull( )
         {
            this[this.tableInvoiceLine.ProductNameColumn] = System.Convert.DBNull ;
         }

         ///  <summary>
         ///   Gets or sets the Value.
         ///  </summary>
         public decimal InvoiceLineProductValue
         {
            get {
               try
               {
                  return ((decimal)(this[this.tableInvoiceLine.InvoiceLineProductValueColumn])) ;
               }
               catch ( InvalidCastException deklaritException )
               {
                  throw new StrongTypingException( "Cannot get value InvoiceLineProductValue because it is DBNull.", deklaritException) ;
               }
            }

            set {
               this[this.tableInvoiceLine.InvoiceLineProductValueColumn] = value ;
            }

         }

         public bool IsInvoiceLineProductValueNull( )
         {
            return this.IsNull( this.tableInvoiceLine.InvoiceLineProductValueColumn) ;
         }

         public void SetInvoiceLineProductValueNull( )
         {
            this[this.tableInvoiceLine.InvoiceLineProductValueColumn] = System.Convert.DBNull ;
         }

         ///  <summary>
         ///   Gets or sets the Quantity.
         ///  </summary>
         public short InvoiceLineProductQuantity
         {
            get {
               try
               {
                  return ((short)(this[this.tableInvoiceLine.InvoiceLineProductQuantityColumn])) ;
               }
               catch ( InvalidCastException deklaritException )
               {
                  throw new StrongTypingException( "Cannot get value InvoiceLineProductQuantity because it is DBNull.", deklaritException) ;
               }
            }

            set {
               this[this.tableInvoiceLine.InvoiceLineProductQuantityColumn] = value ;
            }

         }

         public bool IsInvoiceLineProductQuantityNull( )
         {
            return this.IsNull( this.tableInvoiceLine.InvoiceLineProductQuantityColumn) ;
         }

         public void SetInvoiceLineProductQuantityNull( )
         {
            this[this.tableInvoiceLine.InvoiceLineProductQuantityColumn] = System.Convert.DBNull ;
         }

      }

      public class InvoiceLineRowChangeEvent : EventArgs
      {
         private InvoiceLineRow eventRow ;
         private System.Data.DataRowAction eventAction ;
         public InvoiceLineRowChangeEvent( InvoiceLineRow row ,
                                           DataRowAction action )
         {
            this.eventRow = row ;
            this.eventAction = action ;
         }

         public InvoiceLineRow Row
         {
            get {
               return this.eventRow ;
            }

         }

         public DataRowAction Action
         {
            get {
               return this.eventAction ;
            }

         }

      }

      public class InvoiceRow : DataRow
      {
         private InvoiceDataTable tableInvoice ;
         internal InvoiceRow( DataRowBuilder rb ) : base(rb)
         {
            this.tableInvoice = ((InvoiceDataTable)(this.Table)) ;
         }

         public InvoiceLineRow[] GetInvoiceLineRows( )
         {
            return ((InvoiceLineRow[])(this.GetChildRows( "Invoice_InvoiceLine"))) ;
         }

         ///  <summary>
         ///   Gets or sets the Invoice Id.
         ///  </summary>
         public short InvoiceId
         {
            get {
               return ((short)(this[this.tableInvoice.InvoiceIdColumn])) ;
            }

            set {
               this[this.tableInvoice.InvoiceIdColumn] = value ;
            }

         }

         public bool IsInvoiceIdNull( )
         {
            return this.IsNull( this.tableInvoice.InvoiceIdColumn) ;
         }

         ///  <summary>
         ///   Gets or sets the Invoice Description.
         ///  </summary>
         public String InvoiceDescription
         {
            get {
               try
               {
                  return ((String)(this[this.tableInvoice.InvoiceDescriptionColumn])) ;
               }
               catch ( InvalidCastException deklaritException )
               {
                  throw new StrongTypingException( "Cannot get value InvoiceDescription because it is DBNull.", deklaritException) ;
               }
            }

            set {
               this[this.tableInvoice.InvoiceDescriptionColumn] = value ;
            }

         }

         public bool IsInvoiceDescriptionNull( )
         {
            return this.IsNull( this.tableInvoice.InvoiceDescriptionColumn) ;
         }

         public void SetInvoiceDescriptionNull( )
         {
            this[this.tableInvoice.InvoiceDescriptionColumn] = System.Convert.DBNull ;
         }

         ///  <summary>
         ///   Gets or sets the Cliente.
         ///  </summary>
         public short ClienteId
         {
            get {
               try
               {
                  return ((short)(this[this.tableInvoice.ClienteIdColumn])) ;
               }
               catch ( InvalidCastException deklaritException )
               {
                  throw new StrongTypingException( "Cannot get value ClienteId because it is DBNull.", deklaritException) ;
               }
            }

            set {
               this[this.tableInvoice.ClienteIdColumn] = value ;
            }

         }

         public bool IsClienteIdNull( )
         {
            return this.IsNull( this.tableInvoice.ClienteIdColumn) ;
         }

         public void SetClienteIdNull( )
         {
            this[this.tableInvoice.ClienteIdColumn] = System.Convert.DBNull ;
         }

         ///  <summary>
         ///   Gets or sets the Cliente.
         ///  </summary>
         public String ClienteName
         {
            get {
               try
               {
                  return ((String)(this[this.tableInvoice.ClienteNameColumn])) ;
               }
               catch ( InvalidCastException deklaritException )
               {
                  throw new StrongTypingException( "Cannot get value ClienteName because it is DBNull.", deklaritException) ;
               }
            }

            set {
               this[this.tableInvoice.ClienteNameColumn] = value ;
            }

         }

         public bool IsClienteNameNull( )
         {
            return this.IsNull( this.tableInvoice.ClienteNameColumn) ;
         }

         public void SetClienteNameNull( )
         {
            this[this.tableInvoice.ClienteNameColumn] = System.Convert.DBNull ;
         }

         ///  <summary>
         ///   Gets or sets the Invoice Line Last Index.
         ///  </summary>
         public short InvoiceLineLastIndex
         {
            get {
               try
               {
                  return ((short)(this[this.tableInvoice.InvoiceLineLastIndexColumn])) ;
               }
               catch ( InvalidCastException deklaritException )
               {
                  throw new StrongTypingException( "Cannot get value InvoiceLineLastIndex because it is DBNull.", deklaritException) ;
               }
            }

            set {
               this[this.tableInvoice.InvoiceLineLastIndexColumn] = value ;
            }

         }

         public bool IsInvoiceLineLastIndexNull( )
         {
            return this.IsNull( this.tableInvoice.InvoiceLineLastIndexColumn) ;
         }

         public void SetInvoiceLineLastIndexNull( )
         {
            this[this.tableInvoice.InvoiceLineLastIndexColumn] = System.Convert.DBNull ;
         }

      }

      public class InvoiceRowChangeEvent : EventArgs
      {
         private InvoiceRow eventRow ;
         private System.Data.DataRowAction eventAction ;
         public InvoiceRowChangeEvent( InvoiceRow row ,
                                       DataRowAction action )
         {
            this.eventRow = row ;
            this.eventAction = action ;
         }

         public InvoiceRow Row
         {
            get {
               return this.eventRow ;
            }

         }

         public DataRowAction Action
         {
            get {
               return this.eventAction ;
            }

         }

      }

   }

}
